// pages/history/history.js
Page({
    data: {
      messages: []
    },
    onLoad() {
      this.loadHistory();
    },
    loadHistory() {
      const history = wx.getStorageSync('chat_history') || [];
      this.setData({
        messages: history
      });
    }
  });